using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Data;using THSERP.BusinessEntities;using THSERP.BaseProvider;

namespace THSERP.Modules.Report
{
    public partial class APRP017ReturnSuppliersGridControl : THSGridControl
    {
        protected override DevExpress.XtraGrid.Views.Grid.GridView InitializeGridView()
        {
            base.InitializeGridView();
            DevExpress.XtraGrid.Views.Grid.GridView gridView = base.InitializeGridView();
            gridView.OptionsView.ShowFooter = true;

            DevExpress.XtraGrid.Columns.GridColumn colTotalCost = gridView.Columns["APReturnSupplierTotalCost"];
            colTotalCost.SummaryItem.FieldName = "APReturnSupplierTotalCost";
            colTotalCost.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
            colTotalCost.SummaryItem.DisplayFormat = "{0:n2}";

            gridView.SortInfo.Add(new DevExpress.XtraGrid.Columns.GridColumnSortInfo(gridView.Columns["APReturnSupplierDate"], DevExpress.Data.ColumnSortOrder.Descending));
            return gridView;
        }

        protected override string GetLookupTableDisplayColumn(string strLookupTableName)
        {
            switch (strLookupTableName)
            {
                case "HREmployees":
                    return "HREmployeeLName";
                default:
                    return base.GetLookupTableDisplayColumn(strLookupTableName);
            }
        }
    }
}
